﻿using Might.Infrastructure.Annotations.Graphics;
using Might.Infrastructure.ModelicaDOM;

namespace Might.Modelica.Annotations.Graphics {
    ///<summary>
    ///</summary>
    [Mapping("Ellipse")]
    public class GraphicsEllipse : GraphicsFilledShapeEx, IGraphicsEllipse {
        /// <summary>
        /// </summary>
        public GraphicsEllipse() {
            StartAngle = 0;
            EndAngle = 0;        
        }

        #region IGraphicsEllipse Members
        
        [Mapping("startAngle")]
        public double StartAngle {
            get { return startAngle; }
            set {
                if (startAngle != value) {
                    startAngle = value;
                    OnChanged(this, "StartAngle");
                }
            }
        }
        private double startAngle;   
    
        [Mapping("endAngle")]
        public double EndAngle {
            get { return endAngle; }
            set {
                if (endAngle != value) {
                    endAngle = value;
                    OnChanged(this, "EndAngle");
                }
            }
        }
        private double endAngle;

        #endregion

        #region Specific Modelica members

        public override bool IsDefault {
            get {
                return base.IsDefault &&
                       startAngle == 0 &&
                       endAngle == 0;
            }
        }

        #endregion
    }
}
